package com.zhuzhe.blog.feign.label;




import com.zhuzhe.blog.category.responseVo.LabellistVo;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

//也可以直接在question 系统中写, 只是单独抽取出来,方便维护
// value 指定目标微服务名字，path 目标微服务的上下路径contextPath值，如果目标微服务没有配置contextPath则不需要此path。
@FeignClient(value = "category-server", path = "/category")
public interface IFeignLabelController {

//    allowMultiple = true 表示是数组格式的参数，  dataType = "String" 数组中参数的类型
    @ApiImplicitParam(allowMultiple = true, dataType = "String"
            , name="ids", value = "标签ID集合", required = true)
    @ApiOperation("Feign接口-根据标签ids查询对应的标签信息")
    @GetMapping("/api/feign/label/list/{ids}")
    List<LabellistVo> getLabelListByIds(@PathVariable("ids") List<String> labelIds);

    @ApiImplicitParam( dataType = "String"
            , name="id", value = "分类id", required = true)
    @ApiOperation("Feign接口-根据标签id查询对应的标签信息")
    @GetMapping("/api/feign/getLabelId/{id}")
    List<String> getLabelListByIds(@PathVariable("id") String categoryId);

}
